from wcs.libs.players import players
from wcs.libs.items import items

itemName = 'Ring of Armor'
item = items.addItem(itemName)
item.setGroup("defense")
item.setCost(1000)
item.setDescription("This protective ring can stop bullets. +120 armor")
item.aliveToUse = True
item.setMaxCount(1)

def wcs_item_bought(event_var):
    """
    Executed when this item is purchased. Add the additional armor to the
    player.
    """
    if event_var['item'] == itemName:
        userid = event_var["userid"]
        player = players[userid]
        player.armorAdd(120)